home *** CD-ROM | disk | FTP | other *** search
/ Young Minds / Young Minds Interactive CD-ROM.ISO / umoria / types.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-28  |  10.3 KB  |  316 lines

  1. typedef unsigned char byteint;
  2. #ifdef NO_SIGNED_CHARS
  3. typedef short bytlint;
  4. #else
  5. typedef char bytlint;
  6. #endif
  7. typedef unsigned short wordint;
  8. typedef short worlint;
  9.  
  10. typedef char atype[17];
  11. typedef char btype[15];
  12. typedef char ctype[27];
  13. typedef char dtype[6];
  14. typedef char etype[35];
  15. typedef char ttype[80];
  16. typedef char vtype[80];
  17. typedef char stat_type[7];
  18.  
  19. typedef struct creature_type
  20. {
  21.   ctype name;           /* Descrip of creature    */
  22.   unsigned int cmove;    /* Bit field        */
  23.   unsigned int spells;  /* Creature spells    */
  24.   wordint cdefense;    /* Bit field        */
  25.   worlint sleep;    /* Inactive counter    */
  26.   wordint mexp;     /* Exp value for kill    */
  27.   byteint aaf;          /* Area affect radius    */
  28.   byteint ac;           /* AC            */
  29.   bytlint speed;    /* Movement speed    */
  30.   char cchar;        /* Character rep.    */
  31.   dtype hd;             /* Creatures hit die    */
  32.   etype damage;         /* Type attack and damage*/
  33.   byteint level;    /* Level of creature    */
  34. } creature_type;
  35.  
  36. typedef struct monster_type
  37. {
  38.   worlint hp;       /* Hit points        */
  39.   worlint csleep;    /* Inactive counter    */
  40.   worlint cdis;            /* Cur dis from player    */
  41.   wordint mptr;            /* Pointer into creature    */
  42.   wordint nptr;            /* Pointer to next block    */
  43.   bytlint cspeed;    /* Movement speed    */
  44.   /* Note: FY and FX constrain dungeon size to 255    */
  45.   byteint fy;            /* Y Pointer into map    */
  46.   byteint fx;            /* X Pointer into map    */
  47.   int stunned;           /* Rounds stunned*/
  48.   int ml;               /* On if shown   */
  49.   int confused;         /* On if confused*/
  50. } monster_type;
  51.  
  52. typedef struct treasure_type
  53. {
  54.   ttype name;            /* Object name        */
  55.   byteint tval;            /* Category number    */
  56.   char tchar;        /* Character representation*/
  57.   unsigned int flags;    /* Special flags        */
  58.   int p1;            /* Misc. use variable    */
  59.   int cost;            /* Cost of item        */
  60.   int subval;            /* Sub-category number    */
  61.   wordint weight;    /* Weight        */
  62.   wordint number;    /* Number of items    */
  63.   worlint tohit;    /* Plusses to hit        */
  64.   worlint todam;    /* Plusses to damage    */
  65.   worlint ac;            /* Normal AC        */
  66.   worlint toac;            /* Plusses to AC        */
  67.   dtype damage;            /* Damage when hits    */
  68.   bytlint level;    /* Level item found    */
  69. } treasure_type;
  70.  
  71. typedef struct player_type
  72. {
  73.   struct misc
  74.     {
  75.       vtype name;    /* Name of character    */
  76.       vtype race;    /* Race of character    */
  77.       vtype sex;    /* Sex of character    */
  78.       vtype title;    /* Character's title    */
  79.       vtype tclass;    /* Character's class    */
  80.       int max_exp;    /* Max experience*/
  81.       int exp;            /* Cur experience    */
  82.       int au;            /* Gold        */
  83.       wordint age;    /* Characters age*/
  84.       wordint ht;    /* Height    */
  85.       wordint wt;    /* Weight    */
  86.       wordint lev;    /* Level        */
  87.       wordint max_lev;    /* Max level explored*/
  88.       worlint srh;    /* Chance in search*/
  89.       worlint fos;    /* Frenq of search*/
  90.       worlint bth;    /* Base to hit    */
  91.       worlint bthb;    /* BTH with bows    */
  92.       worlint mana;    /* Mana points    */
  93.       worlint mhp;    /* Max hit pts    */
  94.       worlint ptohit;    /* Plusses to hit    */
  95.       worlint ptodam;    /* Plusses to dam    */
  96.       worlint pac;    /* Total AC    */
  97.       worlint ptoac;    /* Magical AC    */
  98.       worlint dis_th;    /* Display +ToHit*/
  99.       worlint dis_td;    /* Display +ToDam*/
  100.       worlint dis_ac;    /* Display +ToAC */
  101.       worlint dis_tac;    /* Display +ToTAC*/
  102.       worlint disarm;    /* % to Disarm    */
  103.       worlint save;    /* Saving throw    */
  104.       worlint sc;    /* Social Class    */
  105.       byteint pclass;    /* # of class        */
  106.       byteint prace;    /* # of race        */
  107.       byteint hitdie;    /* Char hit die    */
  108.       bytlint stl;    /* Stealth factor*/
  109.       double expfact;    /* Experience factor*/
  110.       double cmana;    /* Cur mana pts  */
  111.       double chp;      /* Cur hit pts    */
  112.       vtype history[5]; /* History record*/
  113.     } misc;
  114.   struct stats
  115.     {
  116.       byteint str;    /* Max strength          */
  117.       byteint cstr;    /* Current strength    */
  118.       byteint dex;    /* Max dexterity          */
  119.       byteint cdex;    /* Current dexterity   */
  120.       byteint con;    /* Max constitution    */
  121.       byteint ccon;    /* Current constitution*/
  122.       byteint intel;    /* Max intelligence    */
  123.       byteint cint;    /* Current intelligence*/
  124.       byteint wis;    /* Max wisdom          */
  125.       byteint cwis;    /* Current wisdom      */
  126.       byteint chr;    /* Max charisma          */
  127.       byteint cchr;    /* Current charisma    */
  128.     } stats;
  129.   struct flags
  130.     {
  131.       unsigned int status;    /* Status of player    */
  132.       int rest;                    /* Rest counter          */
  133.       int blind;            /* Blindness counter   */
  134.       int paralysis;            /* Paralysis counter   */
  135.       int confused;            /* Confusion counter   */
  136.       int food;                    /* Food counter        */
  137.       int food_digested;    /* Food per round      */
  138.       int protection;            /* Protection fr. evil */
  139.       int speed;            /* Cur speed adjust    */
  140.       int fast;                    /* Temp speed change   */
  141.       int slow;                    /* Temp speed change   */
  142.       int afraid;            /* Fear                */
  143.       int poisoned;            /* Poisoned            */
  144.       int image;            /* Hallucinate          */
  145.       int protevil;            /* Protect VS evil     */
  146.       int invuln;            /* Increases AC        */
  147.       int hero;                    /* Heroism          */
  148.       int shero;            /* Super Heroism          */
  149.       int blessed;            /* Blessed          */
  150.       int resist_heat;            /* Timed heat resist   */
  151.       int resist_cold;            /* Timed cold resist   */
  152.       int detect_inv;            /* Timed see invisible */
  153.       int word_recall;            /* Timed teleport level*/
  154.       int see_infra;            /* See warm creatures  */
  155.       int tim_infra;            /* Timed infra vision  */
  156.       int see_inv;            /* Can see invisible   */
  157.       int teleport;            /* Random teleportation*/
  158.       int free_act;            /* Never paralyzed     */
  159.       int slow_digest;            /* Lower food needs    */
  160.       int aggravate;            /* Aggravate monsters   */
  161.       int fire_resist;            /* Resistance to fire  */
  162.       int cold_resist;            /* Resistance to cold  */
  163.       int acid_resist;            /* Resistance to acid  */
  164.       int regenerate;            /* Regenerate hit pts  */
  165.       int lght_resist;            /* Resistance to light */
  166.       int ffall;            /* No damage falling   */
  167.       int sustain_str;            /* Keep strength       */
  168.       int sustain_int;            /* Keep intelligence   */
  169.       int sustain_wis;            /* Keep wisdom         */
  170.       int sustain_con;            /* Keep constitution   */
  171.       int sustain_dex;            /* Keep dexterity      */
  172.       int sustain_chr;            /* Keep charisma       */
  173.       int confuse_monster;    /* Glowing hands...    */
  174.     } flags;
  175. } player_type;
  176.  
  177. typedef struct spell_type
  178. {
  179.   ctype sname;
  180.   byteint slevel;
  181.   byteint smana;
  182.   wordint sexp;
  183.   byteint sfail;
  184.   int learned;
  185. } spell_type;
  186.  
  187. typedef struct spl_rec
  188. {
  189.   int splnum;
  190.   int splchn;
  191. } spl_rec;
  192.  
  193. typedef spl_rec spl_type[22];
  194.  
  195. typedef struct race_type
  196. {
  197.   vtype trace;        /* Type of race        */
  198.   bytlint str_adj;    /* adjustments        */
  199.   bytlint int_adj;
  200.   bytlint wis_adj;
  201.   bytlint dex_adj;
  202.   bytlint con_adj;
  203.   bytlint chr_adj;
  204.   wordint b_age;        /* Base age of character    */
  205.   wordint m_age;        /* Maximum age of character    */
  206.   wordint m_b_ht;       /* base height for males    */
  207.   wordint m_m_ht;       /* mod height for males    */
  208.   wordint m_b_wt;       /* base weight for males    */
  209.   wordint m_m_wt;       /* mod weight for males    */
  210.   wordint f_b_ht;       /* base height females    */
  211.   wordint f_m_ht;       /* mod height for females    */
  212.   wordint f_b_wt;       /* base weight for female    */
  213.   wordint f_m_wt;       /* mod weight for females    */
  214.   double b_exp;            /* Base experience factor    */
  215.   bytlint b_dis;        /* base chance to disarm    */
  216.   bytlint srh;          /* base chance for search    */
  217.   bytlint stl;          /* Stealth of character    */
  218.   bytlint fos;          /* frequency of auto search    */
  219.   bytlint bth;          /* adj base chance to hit    */
  220.   bytlint bthb;         /* adj base to hit with bows    */
  221.   bytlint bsav;         /* Race base for saving throw    */
  222.   bytlint bhitdie;      /* Base hit points for race    */
  223.   bytlint infra;        /* See infra-red        */
  224.   unsigned int tclass;  /* Bit field for class types    */
  225. } race_type;
  226.  
  227. typedef struct class_type
  228. {
  229.   vtype title;             /* type of class        */
  230.   double m_exp;         /* Class experience factor    */
  231.   bytlint adj_hd;        /* Adjust hit points        */
  232.   bytlint mdis;          /* mod disarming traps    */
  233.   bytlint msrh;          /* modifier to searching    */
  234.   bytlint mstl;          /* modifier to stealth    */
  235.   bytlint mfos;          /* modifier to freq-of-search    */
  236.   bytlint mbth;          /* modifier to base to hit    */
  237.   bytlint mbthb;         /* modifier to base to hit - bows*/
  238.   bytlint msav;          /* Class modifier to save    */
  239.   bytlint madj_str;      /* Class modifier for strength*/
  240.   bytlint madj_int;      /* Class modifier for intelligence*/
  241.   bytlint madj_wis;      /* Class modifier for wisdom    */
  242.   bytlint madj_dex;      /* Class modifier for dexterity*/
  243.   bytlint madj_con;      /* Class modifier for constitution*/
  244.   bytlint madj_chr;      /* Class modifier for charisma*/
  245.   int pspell;             /* class use priest spells    */
  246.   int mspell;             /* class use mage spells    */
  247. } class_type;
  248.  
  249. typedef struct background_type
  250. {
  251.   vtype info;       /* History information    */
  252.   byteint roll;    /* Die roll needed for history*/
  253.   byteint chart;   /* Table number        */
  254.   bytlint next;    /* Pointer to next table    */
  255.   bytlint bonus;   /*  Bonus to the Social Class    */
  256. } background_type;
  257.  
  258. typedef struct floor_type
  259. {
  260.   int ftval;
  261.   int ftopen;
  262. } floor_type;
  263.  
  264. typedef struct cave_type
  265. {
  266.   byteint cptr;
  267.   byteint tptr;
  268.   int fval;
  269.   int fopen;
  270.   int fm;          /* used for hidden objects */
  271.   int pl;
  272.   int tl;
  273. } cave_type;
  274.  
  275. typedef struct owner_type
  276. {
  277.   vtype owner_name;
  278.   worlint max_cost;
  279.   double max_inflate;
  280.   double min_inflate;
  281.   double haggle_per;
  282.   byteint owner_race;
  283.   byteint insult_max;
  284. } owner_type;
  285.  
  286. typedef struct inven_record
  287. {
  288.   int scost;
  289.   treasure_type sitem;
  290. } inven_record;
  291.  
  292. typedef struct store_type
  293. {
  294.   worlint store_open;
  295.   short insult_cur;
  296.   byteint owner;
  297.   byteint store_ctr;
  298.   inven_record store_inven[STORE_INVEN_MAX];
  299. } store_type;
  300.  
  301. typedef struct high_scores
  302. {
  303.   long int points;
  304.   wordint lev;
  305.   wordint max_lev;
  306.   worlint mhp;
  307.   double chp;
  308.   int uid;
  309.   int dun_level;
  310.   char sex;
  311.   vtype name;
  312.   vtype died_from;
  313.   byteint pclass;
  314.   byteint prace;
  315. } high_scores;
  316.